package com.yunkazaixian.syntelecom.entity;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Data;

import java.util.List;

@JacksonXmlRootElement(localName ="ContractRoot")
@Data
public class PushDaliang {
    @JacksonXmlProperty(localName = "ICCID")
    private String iccid;

    @JacksonXmlProperty(localName = "ACCNBR")
    private String telephone;

    @JacksonXmlProperty(localName = "SENDDT")
    private String sendTime;

    @JacksonXmlProperty(localName = "STATUSINFO")
    private String statusInfo;

    @JacksonXmlProperty(localName = "ACCEPTTYPE")
    private String acceptType;

    @JacksonXmlProperty(localName = "data")
    private DataInfo data;

    @Data
    public static class DataInfo {
        @JacksonXmlProperty(localName = "PRODNAME")
        private String prodName;

        @JacksonXmlProperty(localName = "PRODUCTCODE")
        private String productCode;
        @JacksonXmlElementWrapper(useWrapping = false)
        @JacksonXmlProperty(localName = "ATTRS")
        private List<Attrs> afterAttrs;

        public DataInfo(String prodName, String productCode,List<Attrs> afterAttrs) {
            this.prodName = prodName;
            this.productCode = productCode;
            this.afterAttrs = afterAttrs;
        }

    }
    @Data
    public static class Attrs {
        @JacksonXmlProperty(localName = "CHANGEATTRNAME")
        private String changeattrname;

        @JacksonXmlProperty(localName = "AFTERATTRS")
        private String afterAttrs;
        public Attrs(String changeattrname, String afterAttrs) {
            this.changeattrname = changeattrname;
            this.afterAttrs = afterAttrs;
        }
    }
}
